﻿#region License
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Classless.Hasher - C#/.NET Hash and Checksum Algorithm Library.
 *
 * The Initial Developer of the Original Code is Classless.net.
 * Portions created by the Initial Developer are Copyright (C) 2009 the Initial
 * Developer. All Rights Reserved.
 *
 * Contributor(s):
 *		Jason Simeone (jay@classless.net)
 * 
 * ***** END LICENSE BLOCK ***** */
#endregion

using System;
using Classless.Hasher;

namespace Classless.Hasher.Tests {
	class TestVectorsHMAC : TestVectors {
		static public object[] Vectors = {
			new object[] { new MD5(), h("0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B"), s("Hi There"), h("9294727A3638BB1C13F48EF8158BFC9D") },
			new object[] { new MD5(), s("Jefe"), s("what do ya want for nothing?"), h("750C783E6AB0B503EAA86E310A5DB738") },
			new object[] { new MD5(), h("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), h("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"), h("56BE34521D144C88DBB8C733F0E8B3F6") },

			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s(""), h("AD9DB2C1E22AF9AB5CA9DBE5A86F67DC") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("a"), h("3BF448C762DE00BCFA0310B11C0BDE4C") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("abc"), h("F34EC0945F02B70B8603F89E1CE4C78C") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("message digest"), h("E8503A8AEC2289D82AA0D8D445A06BDD") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("abcdefghijklmnopqrstuvwxyz"), h("EE880B735CE3126065DE1699CC136199") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"), h("794DAF2E3BDEEA2538638A5CED154434") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), h("3A06EEF165B23625247800BE23E232B6") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), s("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), h("9A4F0159C0952DA43A8D466D46B0AF58") },
			new object[] { new RIPEMD128(), h("00112233445566778899AABBCCDDEEFF"), Battery.MillionAs, h("19B1B3AF333B894DD86D09427116D0AD") },

			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s(""), h("8931EEEE56A6B257FD1AB5418183D826") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("a"), h("DBBCF169EA7419D5BA7BD8EB3673FF2D") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("abc"), h("2C4CD07D3162D6A0E338004D6B6FBC9A") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("message digest"), h("75BFB25888F4BB77C77AE83AD0817447") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("abcdefghijklmnopqrstuvwxyz"), h("B1B5DC0FCB7258758855DD1840FCDCE4") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"), h("670D0F7A697B18F1A8AB7D2A2A00DBC1") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), h("54E315FDB34A61C0475392E5C7852998") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), s("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), h("AD04354D8AA2A623E72E3594EE3535C0") },
			new object[] { new RIPEMD128(), h("0123456789ABCDEFFEDCBA9876543210"), Battery.MillionAs, h("6F9B1C0FC06753618D6DB4B007733795") },

			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s(""), h("CF387677BFDA8483E63B57E06C3B5ECD8B7FC055") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("a"), h("0D351D71B78E36DBB7391C810A0D2B6240DDBAFC") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("abc"), h("F7EF288CB1BBCC6160D76507E0A3BBF712FB67D6") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("message digest"), h("F83662CC8D339C227E600FCD636C57D2571B1C34") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("abcdefghijklmnopqrstuvwxyz"), h("843D1C4EB880AC8AC0C9C95696507957D0155DDB") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"), h("60F5EF198A2DD5745545C1F0C47AA3FB5776F881") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), h("E49C136A9E5627E0681B808A3B97E6A6E661AE79") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), s("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), h("31BE3CC98CEE37B79B0619E3E1C2BE4F1AA56E6C") },
			new object[] { new RIPEMD160(), h("00112233445566778899AABBCCDDEEFF01234567"), Battery.MillionAs, h("C2AA88C6405658DC225E485488371FB2433FA735") },

			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s(""), h("FE69A66C7423EEA9C8FA2EFF8D9DAFB4F17A62F5") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("a"), h("85743E899BC82DBFA36FAAA7A25B7CFD372432CD") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("abc"), h("6E4AFD501FA6B4A1823CA3B10BD9AA0BA97BA182") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("message digest"), h("2E066E624BADB76A184C8F90FBA053330E650E92") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("abcdefghijklmnopqrstuvwxyz"), h("07E942AA4E3CD7C04DEDC1D46E2E8CC4C741B3D9") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"), h("B6582318DDCFB67A53A67D676B8AD869ADED629A") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), h("F1BE3EE877703140D34F97EA1AB3A07C141333E2") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), s("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), h("85F164703E61A63131BE7E45958E0794123904F9") },
			new object[] { new RIPEMD160(), h("0123456789ABCDEFFEDCBA987654321000112233"), Battery.MillionAs, h("82A504A002BA6E6C67F3CD67CEDB66DC169BAB7A") },

			new object[] { new SHA256(), h("0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20"), s("abc"), h("A21B1F5D4CF4F73A4DD939750F7A066A7F98CC131CB16A6692759021CFAB8181") },
			new object[] { new SHA256(), h("0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20"), s("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"), h("104FDC1257328F08184BA73131C53CAEE698E36119421149EA8C712456697D30") },
			new object[] { new SHA256(), h("0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20"), s("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqabcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"), h("470305FC7E40FE34D3EEB3E773D95AAB73ACF0FD060447A5EB4595BF33A9D1A3") },
		};
	}
}
